#pragma once
#include "ClockListener.h"
#include <vector>
#include <algorithm>
#include <functional>
#include "windows.h"
#include "event.h"
#define WIN32_LEAN_AND_MEAN
using namespace std;
namespace Core
{
	using namespace Pattern;
	namespace Devices
	{
		class ClockListener;


		class ClockSource:public Source<ClockSource,ClockListener>
		{

		public:
			ClockSource(int FPS=23);
			void tick();
			~ClockSource(void);
			int GetFPS(void);
			void SetAverage(double average);
		private:
			int m_FpsCount;
			int m_Fps;
			double m_Average;
			LARGE_INTEGER m_LastCount;

			LARGE_INTEGER now;
			LARGE_INTEGER last;
			LARGE_INTEGER frequency;
			double interval;
		};

	}
}